package com.xu.rag.config;

import com.xu.rag.interceptor.ModelInterceptor;
import org.springframework.aop.aspectj.AspectJExpressionPointcut;
import org.springframework.aop.support.DefaultPointcutAdvisor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: xdl
 * @CreateTime: 2025-01-15 23:05
 * @Description:
 */
@Configuration
public class ModelConfiguration {

    @Bean
    public DefaultPointcutAdvisor zzz() {
        ModelInterceptor modelInterceptor = new ModelInterceptor();
        DefaultPointcutAdvisor defaultPointcutAdvisor = new DefaultPointcutAdvisor();
        AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut();
        pointcut.setExpression("@annotation(com.xu.rag.common.annotation.ModelPoint)");
        defaultPointcutAdvisor.setPointcut(pointcut);
        defaultPointcutAdvisor.setAdvice(modelInterceptor);
        return defaultPointcutAdvisor;
    }
}
